<?php
/**
 * 基础类
 * Created by RisingSun
 * User: MarkSpace
 * Create on 2023/3/26 15:16
 */

namespace common;

/**
 * 基础控制器
 */
class Base 
{
    /**
     * 返回格式化json数据
     *
     * @param int $code
     * @param string $msg
     * @param array $data
     * @return Response
     */
    protected function json(int $code, string $msg = 'ok', array $data = [])
    {
        return json_encode(['code' => $code, 'data' => $data, 'msg' => $msg], JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
    }

}
